home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Business / Memo Stuff / MemoNoteStack / stack.txt < prev   
Encoding:
Text File  |  1988-04-19  |  13.4 KB  |  374 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x0 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 1
  11. -- first background id: 2781
  12. -- card count: 1
  13. -- first card id: 2885
  14. -- list block id: 4020
  15. -- print block id: 3527
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 29152 bytes
  21. -- stack block size: 13824 bytes
  22. -- created by hypercard version: 0x00000000
  23. -- compacted by hypercard version: 0x00000000
  24. -- modified by hypercard version: 0x00000000
  25. -- opened by hypercard version: 0x00000000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x0000220000002200
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0xCC003300CC003300
  30. -- patterns[4]: 0xCC883322CC883322
  31. -- patterns[5]: 0xEE88BB22EE88BB22
  32. -- patterns[6]: 0xEECCBB33EECCBB33
  33. -- patterns[7]: 0xFFCCFF33FFCCFF33
  34. -- patterns[8]: 0xFFEEFFBBFFEEFFBB
  35. -- patterns[9]: 0xFFFFFFBBFFFFFFBB
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. ***********************
  69. on mousedown -- 6 Jan 88 - ToggleFieldStyle by Peter Fraterdeus
  70.   --‚Ä¢Please Include these comments if you use my NotePads!
  71.   -- This Script was written by Peter Fraterdeus of Alphabets, Inc.
  72.   -- CompuServe 73306,2703. In the interest of keeping StackWare healthy -- you could send comments to 804 Dempster St., Evanston, IL. 60202 !
  73.   -- Thanks!
  74.   --‚Ä¢This works well with the MemoNotes below, since they're card fields
  75.   -- Place in Home stack for global relevance‚Ķ
  76.   set lockScreen to true
  77.   magicCopy
  78.  
  79.   get the name of the target
  80.   if it contains "Field"  then
  81.     if the shiftKey is down and the commandKey is down then
  82.       get style of the target
  83.       if it <>"Scrolling" then
  84.         set style of the target to scrolling
  85.       else
  86.         set style of the target to rectangle -- change for a different
  87.       end if                                 -- default rect.
  88.     end if
  89.   else
  90.     if it contains "button" and it contains "Note" then
  91.       set lockScreen to false
  92.       MoveNote
  93.       exit to hypercard
  94.     end if
  95.   end if
  96. end mousedown
  97. **********************
  98. on MoveNote
  99.   global gMoveNote
  100.   put the mouseLoc into temp
  101.   wait 10 -- if the mouse doesn't move within 10 clicks then forget it
  102.   get the mouseLoc
  103.   if temp<>it  then
  104.     repeat until the mouse is up -- doDragButton
  105.       set the loc of target to the mouseLoc -- a neat trick,
  106.     end repeat
  107.     put true into gMoveNote        -- one of the great qualities of
  108.   else
  109.     put false into gMoveNote       -- object based environments....
  110.   end if
  111.   send mouseup to target       -- I borrowed the concept, but the
  112.   choose browse tool       -- execution is completely my design...
  113. end moveNote
  114.  
  115.  
  116. **********************
  117. on memoNote -- 6 Jan 88 ‚Äî MemoNotes‚Ñ¢ by Peter Fraterdeus
  118.   -- Creates Note button and field on current card.
  119.   --‚Ä¢Shift-Option‚ÄîClick on the MemoNote Button to Copy the button, then
  120.   -- go to your Stack and paste it into the Background.
  121.   --
  122.   --‚Ä¢Cut this "on memoNote" Script and paste it into the Background,
  123.   -- Stack, or Home script. (In Home it will be global for all stacks!)
  124.   -- The only script needed in the MemoNoteButton is‚Ķ
  125.   -- "send copyNote" (and "on mouseup‚Ķend mouseup", of course!)
  126.   --
  127.   --‚Ä¢The Scrolling Note area toggles on and off when the Note Button
  128.   -- is clicked. Note that you can set the size of the default field
  129.   -- by changing fieldWidth and fieldHeight.
  130.   --
  131.   --‚Ä¢Please Include these comments if you use my NotePads!
  132.   -- This Script was written by Peter Fraterdeus of Alphabets, Inc.
  133.   -- CompuServe 73306,2703. In the interest of keeping ShareWare healthy -- you could send $15 to 804 Dempster St., Evanston, IL. 60202 !
  134.   -- Thanks!
  135.   --‚Ä¢Updated 23Jan88 to move notes on click&drag
  136.   -- as well as some other polishing of the code
  137.   set lockscreen to true
  138.   MagicCopy
  139.  
  140.   if the shiftKey is down then -- Shift-Click to edit script*
  141.     edit script of me
  142.     exit memonote          -- * these will work with any button
  143.   else
  144.     Show msg
  145.     put "Click where you want the new Note... (or command-. to cancel)"
  146.     beep
  147.     set cursor to 2
  148.     set lockscreen to true
  149.     wait until the mouse is down
  150.     put the MouseH into HMouse -- "the clickloc" didn't work here!
  151.     put the MouseV into VMouse -- it saved the loc of the MemoNote Bttn.
  152.     set cursor to 4
  153.     put the number of buttons into ButtonNum
  154.     put the number of card fields into FieldNum
  155.     put 200 into fieldWidth  -- change these for different note size.
  156.     put 100 into fieldHeight --
  157.     choose button tool
  158.     drag from HMouse,VMouse to HMouse+70,VMouse+17 with commandKey -- Draw the new Button
  159.  
  160.     choose field tool -- this actually enables the new button so that
  161.     -- its properties may be set...
  162.     put "card button (ButtonNum +1)" into it
  163.     set name of it to "Note" -- don't change this!
  164.     show it
  165.     set style of it to Rectangle
  166.     set autohilite of it to false
  167.     set hilite of it to true
  168.     set showname of it to true
  169.  
  170.  
  171.     drag from HMouse,VMouse+16 to HMouse+fieldWidth, VMouse+fieldHeight with commandKey -- Draw the new Field
  172.  
  173.     choose browse tool -- this actually enables the new field
  174.     get the id of card field (FieldNum +1)
  175.     set name of card field id it to "Note"&&it
  176.     put "card field id " before it
  177.     show it
  178.     set style of it to Scrolling
  179.     set locktext of it to false
  180.     set showlines of it to true
  181.     set textFont of it to Geneva
  182.     set textSize of it to 9
  183.     put it into fieldID
  184.  
  185.     -- *** Building the ButtonScript ***
  186.     put"*NoteButtonScript*"&return after NoteButtonScript
  187.     put"on mouseup"&return after NoteButtonScript
  188.     put"  global gMoveNote"&return after NoteButtonScript
  189.     put"  put the visible of"&&Fieldid&&" into showing"&return after NoteButtonScript
  190.     put"  showfield showing"&return after NoteButtonScript
  191.     put"end mouseUp"&return after NoteButtonScript
  192.     put"**"&return after NoteButtonScript
  193.     put"on killField"&return after NoteButtonScript
  194.     put"  set the visible of"&&Fieldid&&" to true"&return after NoteButtonScript
  195.     put"  choose field Tool"&return after NoteButtonScript
  196.     put"  click at the loc of"&&Fieldid&&""&return after NoteButtonScript
  197.     put"  domenu clear field"&return after NoteButtonScript
  198.     put"end killField"&return after NoteButtonScript
  199.     put"***"&return after NoteButtonScript
  200.     put"on showField showing"&return after NoteButtonScript
  201.     put"  global gMoveNote"&return after NoteButtonScript
  202.     put"  if the paramcount=0 then put false into showing"&return after NoteButtonScript
  203.     put"  if (showing=false and gMoveNote = false)¬¨"&return after NoteButtonScript
  204.     put"  or (showing=true and gMoveNote = true) then"&return after NoteButtonScript
  205.     put"    -- if the field isn't showing and the button hasn't been moved"&return after NoteButtonScript
  206.     put"    -- then show the field in its present location"&return after NoteButtonScript
  207.     put"    -- or if the field is showing but the button has been moved"&return after NoteButtonScript
  208.     put"    -- then reshow the field in its new location"&return after NoteButtonScript
  209.     put"    doHilite true"&return after NoteButtonScript
  210.     put"    get the rect of me"&return after NoteButtonScript
  211.     put"    put it into bRect"&return after NoteButtonScript
  212.     put"    get the rect of "&&Fieldid&&""&return after NoteButtonScript
  213.     put"    put (item 3 of it - item 1 of it) /2 into fH"&return after NoteButtonScript
  214.     put"    put (item 4 of it - item 2 of it) /2 into fV"&return after NoteButtonScript
  215.     put"    show"&&Fieldid&&" at trunc(fH)+item 1 of bRect, ¬¨"&return after NoteButtonScript
  216.     put"    trunc(fV)+item 4 of bRect-1"&return after NoteButtonScript
  217.     put"  else"&return after NoteButtonScript
  218.     put"    doHilite false"&return after NoteButtonScript
  219.     put"    hide"&&Fieldid&&""&return after NoteButtonScript
  220.     put"  end if"&return after NoteButtonScript
  221.     put"end showField"&return after NoteButtonScript
  222.     put"****"&return after NoteButtonScript
  223.     put"MemoNotes‚Ñ¢ Hypernote system"&return after NoteButtonScript
  224.     put"¬©1988 PeterFraterdeus"&return after NoteButtonScript
  225.     put"CIS 73306,2703"&return after NoteButtonScript
  226.     put"ShareWare-$15. to: Alphabets, Inc."&return after NoteButtonScript
  227.     put"804 Dempster St./ Evanston, IL. 60202"&return after NoteButtonScript
  228.  
  229.     choose button tool
  230.     set script of card button (buttonNum +1) to NoteButtonScript
  231.     choose browse tool
  232.     set cursor to 1
  233.     send tabKey to fieldID
  234.     put " " into msg
  235.   end if
  236.  
  237. end memoNote
  238. ***********************
  239.  
  240. ***********************
  241.  
  242.  
  243. on ShowNotes -- 7 Jan '88 by Peter Fraterdeus
  244.   -- Part of the MemoNotes‚Ñ¢ system
  245.   --‚Ä¢Sends a mouseUp message to any button named "Note" on a card
  246.   -- thus toggling the visiblity of the Note Field
  247.   --‚Ä¢Put this script in your Home Stack, and use Shift-Opt.Click
  248.   -- to copy the ShowNotes button, paste in Bkgnd. of your Stack.
  249.   set lockscreen to true
  250.   MagicCopy
  251.   if the shiftKey is down then -- Shift-Click to edit script*
  252.     edit script of me
  253.     exit ShowNotes
  254.   end if
  255.   global HideAll
  256.   if hideAll is True then
  257.     put "showField false" into doWhat
  258.     put False into hideAll
  259.   else
  260.     put "showField true" into doWhat
  261.     put True into hideAll
  262.   end if
  263.   repeat with btn=1 to the number of card buttons
  264.     if the short name of card button btn is "Note" then
  265.       send doWhat to card button btn
  266.     end if
  267.   end repeat
  268. end ShowNotes
  269. ***********************
  270. on doHilite OnOff -- onOff must be either True or False if it exists
  271.   if the paramcount = 0 then
  272.     set the hilite of the Target to not the hilite of the Target
  273.   else
  274.     set the hilite of the Target to onOff
  275.   end if
  276. end doHilite
  277.  
  278. on MagicCopy -- Magic Button Copy by Peter Fraterdeus
  279.   if the shiftKey is down and the optionKey is down and word 2 of the name of the target is "Button"then
  280.   choose button tool
  281.   click at the loc of the target -- Shift-Opt.Click to copy button*
  282.   domenu copy button
  283.   put the short name of the target&&"Button copied..." into msg
  284.   choose browse tool
  285.   exit to hyperCard
  286.  
  287. end if
  288. end MagicCopy
  289. ***********************
  290. on enterkey -- Toggle Browse-Button-Field Tools with EnterKey+Shift
  291.   -- I got this out of Macazine, I believe, from Jerry Daniels and added
  292.   -- the ShiftKey modifier
  293.   if the shiftKey is down then
  294.     if the tool is "browse tool" then choose button tool
  295.     else if the tool is "button tool" then choose field tool
  296.     else choose browse tool
  297.   end if
  298. end enterkey
  299. ***********************
  300. on KillNotes -- 7 Jan '88 by Peter Fraterdeus
  301.   --‚Ä¢Sends a Killnote Message to the Note Button selected, removing
  302.   -- both field (is cut to Clipboard), and button.
  303.   --‚Ä¢Put this script in your Home Stack, and use Shift-Opt.Click
  304.   -- to copy the KillNotes button, paste in Bkgnd. of your Stack.
  305.   set lockscreen to true
  306.   MagicCopy
  307.   if the shiftKey is down then -- Shift-Click to edit script*
  308.     edit script of me
  309.     exit Killnotes
  310.   end if
  311.  
  312.  
  313.   put "Click on NoteButton of note to Clear. (Or elsewhere to cancel)"
  314.   beep
  315.   wait until the mouse is down
  316.   put the mouseLoc into MsLoc
  317.   set cursor to 4
  318.   repeat with whichButton=1 to the number of card buttons
  319.     put "card button"&&whichButton into it
  320.     put the rect of it into targRect
  321.     if PointinRect(MSLOc,TargRect) =true and short name of it = "Note" then
  322.       send killField to it
  323.       choose button tool
  324.       click at Loc of it
  325.       domenu clear button
  326.       set cursor to 1
  327.       choose browse tool
  328.       put " " into msg
  329.       exit killNotes
  330.     end if
  331.   end repeat
  332.   set cursor to 1
  333.   choose browse tool
  334.   put " " into msg
  335. end KillNotes
  336.  
  337.  
  338. ***********************
  339. These are just some little helpers for finding the name and sizes
  340. of objects
  341. ***********************
  342. on showRect targ
  343.   put the rect of targ into msg
  344. end showRect
  345. on getSName targ
  346.   put the short name of targ into msg
  347. end getSName
  348. on getName targ
  349.   put the name of targ into msg
  350. end getName
  351. on showHV targ
  352.   getrect (targ)
  353.   getHV (targ)
  354.   put dH && dV into msg
  355. end showHV
  356. function getHV targ
  357. global dH,dV
  358. getrect (targ)
  359. put item 1 of it - item 3 of it into dH
  360. put item 2 of it - item 4 of it into dV
  361. end getHV
  362. function getRect targ
  363. return the rect of targ
  364. end getRect
  365. function PointinRect apoint,aRect
  366. if item 1 of apoint >= item 1 of aRect and item 1 of apoint <= item 3 of aRect and item 2 of apoint >= item 2 of aRect and item 2 of apoint <= item 4 of aRect
  367. then return true
  368. else
  369.   return false
  370. end if
  371. end PointinRect
  372. ***********************
  373.  
  374.